﻿using System;
using Mbs.ComponentModel.Container.Activation;
using Mbs.ComponentModel.Container.Context;
using Mbs.ComponentModel.Container.Metadata;

namespace Mbs.ComponentModel.Container.Lifestyle
{
    public interface ILifestyleManager:IDisposable
    {
        IMicroKernel Kernel { get; }
        IActivator Activator { get; }
        IComponentInfo Info { get; }
        Action<IComponentInfo, object> OnDestroyed { get; }

        void Init(IActivator activator, IMicroKernel kernel, IComponentInfo info, Action<IComponentInfo, object> onDestroy);
        object Get(ICreateContext ctx);
        bool Release(object instance);
        bool Release();
    }
}
